import random


class BankAccount:
    def __init__(self, balance):
        self.l = []
        self.l.append(balance)

    def deposit(self, amount1):
        new_balance = self.l[0] + amount1
        self.l.clear()
        self.l.append(new_balance)
        return f"本次存入{amount1} 账户余额为{self.l[0]}"

    def withdraw(self, amount2):
        new_balance = self.l[0] - amount2
        self.l.clear()
        self.l.append(new_balance)
        return f"本次取出{amount2} 账户余额为{self.l[0]}"

    def get_balance(self):
        return f"当前账户余额为{self.l[0]}"


def main():
    ba = BankAccount(10000)
    print(ba.get_balance())
    print(ba.deposit(random.randint(2000, 5000)))
    print(ba.withdraw(random.randint(1000, 2000)))
    print(ba.deposit(random.randint(2000, 5000)))
    print(ba.withdraw(random.randint(1000, 2000)))
    print(ba.get_balance())


main()
